//
//  HWExchangeViewController.m
//  嗨文
//
//  Created by 响当当 on 2019/2/18.
//  Copyright © 2019年 dongzheng. All rights reserved.
//

#import "HWExchangeViewController.h"
#import "HWExchangeView.h"

@interface HWExchangeViewController ()
@property (nonatomic, strong)HWExchangeView *exchangeView;
@end

@implementation HWExchangeViewController

- (HWExchangeView *)exchangeView
{
    if (!_exchangeView)
    {
        _exchangeView = [[HWExchangeView alloc]initWithFrame:CGRectMake(0,NAVIBAR_HEIGHT,SCREEN_WIDTH,SCREEN_HEIGHT-NAVIBAR_HEIGHT)];
        [_exchangeView getDate:self.bookCoin];
        
    }
    return _exchangeView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self buryPoint];
    [self setTitle:@"兑换余额"];
    [self setDefaultNav];
    
    [self.view addSubview:self.exchangeView];
}

- (void)buryPoint
{
    NSString *lastStayTime = [kUserDefaults objectForKey:@"time"];
    NSString *nowStayTime = [NSString stringWithFormat:@"%ld",[[HWUtilties getNowTimeTimestamp3] integerValue] - lastStayTime.integerValue];
    
    [HWUtilties buryPointWithStayTime:nowStayTime
                            timestamp:[HWUtilties getNowTimeTimestamp3]
                             memberId:current_User.userID
                              fromUrl:nil
                                toUrl:@"/exchangeGold"
                               fromId:nil
                                 toId:@"4b302f5c6555d87c"];
}
@end
